libmraa: add cmake 4.x compatibility
authorTianling Shen <[email protected]>
Mon, 17 Nov 2025 12:01:27 +0000 (20:01 +0800)
committerTianling Shen <[email protected]>
Fri, 21 Nov 2025 10:11:18 +0000 (18:11 +0800)
Upstream backport.

Signed-off-by: Tianling Shen <[email protected]>
libs/libmraa/patches/002-cmake-bump-minimum-version-to-address-a-deprecation-warni.patch [new file with mode: 0644]
libs/libmraa/patches/010-version.patch

diff --git a/libs/libmraa/patches/002-cmake-bump-minimum-version-to-address-a-deprecation-warni.patch b/libs/libmraa/patches/002-cmake-bump-minimum-version-to-address-a-deprecation-warni.patch
new file mode 100644 (file)
index 0000000..9dd4d6d
--- /dev/null
@@ -0,0 +1,40 @@
+From 92a1337e110464bbb3aaba2b3ede77dc13b3f175 Mon Sep 17 00:00:00 2001
+From: Alex T <[email protected]>
+Date: Sun, 2 Nov 2025 19:06:06 +0100
+Subject: [PATCH] cmake: bump minimum version to address a deprecation warning
+
+This fixes the following warning shown while configuring:
+
+  [cmake] CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
+  [cmake] Compatibility with CMake < 3.10 will be removed from a future version of
+  [cmake] CMake.
+
+We don't have a clearly defined supported distro/versions list, so I
+took Ubuntu 22.04 as arguably the oldest one we'd want to support for
+the reference point. It has CMake 3.22, released in July 2022.
+
+Signed-off-by: Alex T <[email protected]>
+---
+ CMakeLists.txt | 10 ++--------
+ 1 file changed, 2 insertions(+), 8 deletions(-)
+
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -1,15 +1,9 @@
+-cmake_minimum_required (VERSION 2.8.11)
++cmake_minimum_required (VERSION 3.22)
+ project (mraa C)
+ FIND_PACKAGE (Threads REQUIRED)
+-if (CMAKE_VERSION VERSION_LESS "3.1")
+-  if (CMAKE_C_COMPILER_ID STREQUAL "GNU")
+-    set (CMAKE_C_FLAGS "-std=gnu99 ${CMAKE_C_FLAGS}")
+-  endif ()
+-else ()
+-  set (CMAKE_C_STANDARD 99)
+-endif ()
++set (CMAKE_C_STANDARD 99)
+ option (BUILDCPP "Enable C++ (needed by FTDI4222 and tests)" ON)
index 4f9cd119d07cbd6e611bacca9902829fe05cc7bc..977316653306fee281487c04a49ce1eae4e17e00 100644 (file)
@@ -1,6 +1,6 @@
 --- a/CMakeLists.txt
 +++ b/CMakeLists.txt
-@@ -113,12 +113,7 @@ endif()
+@@ -107,12 +107,7 @@ endif()
  set (CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules ${CMAKE_MODULE_PATH})
  
  # Make a version file containing the current version from git.